package com.sf.fy.uav.applet;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Collections;

@SpringBootTest
public class Generator {
    @Test
    public void test() {

        FastAutoGenerator.create("jdbc:mysql://ucshr-m.dbsit.sfcloud.local:3306/msp?autoReconnect=true&useSSL=false&characterEncoding=utf-8", "wxdp", "tu@20230414").globalConfig(builder -> {
            builder.author("LTQ")
                    .enableSwagger()
                    .fileOverride()
                    .outputDir("D://");
        }).packageConfig(builder -> {
            builder.parent("com.sf.fy.uav")
                    .moduleName("applet")
                    .pathInfo(Collections.singletonMap(OutputFile.xml, "D://"));
        }).strategyConfig(builder -> {
            builder.addInclude("user_company")
                    .addTablePrefix("t_", "c_");
        }).templateEngine(new FreemarkerTemplateEngine()).execute();
        System.out.println("");
    }
}
